#!/usr/bin/perl
use XML::Atom;
use XML::Atom::Client;
use warnings;
use strict;

my $atom = XML::Atom::Client->new;
$atom->username('usuario');
$atom->password('contraseña');
my $feed = $atom->getFeed("https://mail.google.com/mail/feed/atom");
my @correos = $feed->entries;

foreach my $correo (@correos){
    print "============================================================\n";
    print "============================================================\n";
    print "Remitente: ". $correo->author->name . "(".$correo->author->email.")\n";
    print "Asunto: " . $correo->title ."\n";
    print "Fecha: ". $correo->issued. "\n";
    print "Entradilla: " . $correo->summary ."\n\n";
}
